/**********************************************************************************
***
***    Screencasting Teaching System C++ Library
***    Copyright (C) 2011  Jiri Novak <jiri.novak@petriny.net>
***                        Wadi Jalil Maluf <wadijm@gmail.com>
***
***    This file is part of the Screencasting Teaching System C++ Library.
***
***    This library is free software; you can redistribute it and/or modify
***    it under the terms of the GNU General Public License as published by
***   the Free Software Foundation; either version 3 of the License, or
***    (at your option) any later version.
***
***    This library is distributed in the hope that it will be useful,
***    but WITHOUT ANY WARRANTY; without even the implied warranty of
***    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
***   GNU General Public License for more details.
***
***    You should have received a copy of the GNU General Public License
***    along with this library; if not, write to the Free Software
***    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
***
*********************************************************************************/

#ifndef SCREENCASTING_TEACHING_SYSTEM___COMMON___MODEL___COURSE_H_
#define SCREENCASTING_TEACHING_SYSTEM___COMMON___MODEL___COURSE_H_

#include <string>
#include <time.h>
#include <list>
#include "lesson.h"

/**
 *
 */
class Course {
public:
	Course();
	virtual ~Course();

	std::string getCode() const { return code; }
	std::string getDescription() const { return description; }
	time_t getEndDate() const { return endDate; }
	std::string getKey() const { return key; }
 	std::list<Lesson*>& getLessons() { return lessons; }
 	std::list<User*>& getStudents() { return students; }
 	std::list<User*>& getInstructors() { return instructors; }
	std::string getName() const { return name; }
 	time_t getStartDate() const { return startDate; }
 	void setCode(std::string code) { this->code = code; }
	void setDescription(std::string description) { this->description = description; }
 	void setEndDate(time_t endDate) { this->endDate = endDate; }
	void setKey(std::string key) { this->key = key; }
	void setLessons(std::list<Lesson*> & lessons) { this->lessons = lessons; }
	void setName(std::string name) { this->name = name; }
	void setStartDate(time_t startDate) { this->startDate = startDate; }
	int getId() const { return id; }
	void setId(int id) { this->id = id; }
	bool isSubscribed(User* user);
private:
	time_t startDate;
	time_t endDate;
	int id;
	std::string key;
	std::string code;
	std::string description;
	std::string name;
	std::list<Lesson*> lessons;
	std::list<User*> students;
	std::list<User*> instructors;
};

#endif /* SCREENCASTING_TEACHING_SYSTEM___COMMON___MODEL___COURSE_H_ */
